package equipments

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type EquipmentRouter struct {
}

// InitEquipmentRouter 初始化 equipment表 路由信息
func (s *EquipmentRouter) InitEquipmentRouter(Router *gin.RouterGroup) {
	equipmentRouter := Router.Group("equipment").Use(middleware.OperationRecord())
	equipmentRouterWithoutRecord := Router.Group("equipment")
	var equipmentApi = v1.ApiGroupApp.EquipmentsApiGroup.EquipmentApi
	{
		equipmentRouter.POST("createEquipment", equipmentApi.CreateEquipment)             // 新建equipment表
		equipmentRouter.DELETE("deleteEquipment", equipmentApi.DeleteEquipment)           // 删除equipment表
		equipmentRouter.DELETE("deleteEquipmentByIds", equipmentApi.DeleteEquipmentByIds) // 批量删除equipment表
		equipmentRouter.PUT("updateEquipment", equipmentApi.UpdateEquipment)              // 更新equipment表
	}
	{
		equipmentRouterWithoutRecord.GET("findEquipment", equipmentApi.FindEquipment)           // 根据ID获取equipment表
		equipmentRouterWithoutRecord.GET("getEquipmentList", equipmentApi.GetEquipmentList)     // 获取equipment表列表
		equipmentRouterWithoutRecord.GET("getEquipmentNumber", equipmentApi.GetEquipmentNumber) // 获取每个总数列表
		equipmentRouterWithoutRecord.GET("getEquipmentDevice", equipmentApi.GetEquipmentDevice) // 获取各种状态表列表
		equipmentRouterWithoutRecord.GET("getEquipmentUseList", equipmentApi.GetEquipmentUse)   // 获取各种状态表列表
		equipmentRouterWithoutRecord.GET("getEquipmentBadList", equipmentApi.GetEquipmentBad)   // 获取各种状态表列表
		equipmentRouterWithoutRecord.GET("getEquipmentRestList", equipmentApi.GetEquipmentRest) // 获取各种状态表列表

	}
}
